import requests
import execjs
import time
with open('SignCode.js',mode='r',encoding='utf-8') as file:
    JsonFile = file.read()

ctx = execjs.compile(JsonFile)



cookies = {
    'pgv_pvid': '6983219160',
    'RK': 'Vfz1u9if0L',
    'ptcz': 'bbb241f9630f156fb14d98aa9be6d276c706468eae05be5302d62fbc6364a388',
    'tvfe_boss_uuid': '1e9a71a452cdd90f',
    'iip': '0',
    'sensorsdata2015jssdkcross': '%7B%22distinct_id%22%3A%22180cd3c4e437a5-023a6f1be1f0b06-4c647e56-1327104-180cd3c4e4472a%22%2C%22first_id%22%3A%22%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E5%BC%95%E8%8D%90%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC%22%2C%22%24latest_referrer%22%3A%22https%3A%2F%2Fwww.yoozhibo.com%2F%22%7D%2C%22%24device_id%22%3A%22180cd3c4e437a5-023a6f1be1f0b06-4c647e56-1327104-180cd3c4e4472a%22%7D',
    'qq_domain_video_guid_verify': 'f08246011c100678e3b27e63ee69a807',
    'fqm_pvqid': '8a0a278d-47a7-483c-a788-9e20fb4adf55',
    '_qimei_q36': '',
    '_qimei_fingerprint': 'cab100068f94021ec44c4082f5660143',
    'o2_uin': '247271591',
    '_clck': '1ay7mpn|1|fla|0',
    'eas_sid': 'w1O7n1K5k3g049M4O7m6F1J3B1',
    'LOLWebSet_AreaBindInfo_1917755878': '%257B%2522areaid%2522%253A%252215%2522%252C%2522areaname%2522%253A%2522%25E6%259A%2597%25E5%25BD%25B1%25E5%25B2%259B%2520%25E7%2594%25B5%25E4%25BF%25A1%2522%252C%2522sRoleId%2522%253A0%252C%2522roleid%2522%253A%25221917755878%2522%252C%2522rolename%2522%253A%2522%25E6%259A%2597%25E6%2583%25B3%25E8%25A6%2581%25E6%25BD%25AE%25E5%25B8%2581%252314004%2522%252C%2522checkparam%2522%253A%2522lol%257Cyes%257C1917755878%257C15%257C1917755878*%257C%257C%257C%257C%2525E6%25259A%252597%2525E6%252583%2525B3%2525E8%2525A6%252581%2525E6%2525BD%2525AE%2525E5%2525B8%252581%25252314004*%257C%257C%257C1716342317%257C%2522%252C%2522md5str%2522%253A%2522576B3132B6F8D43CEDABBD7A537AD8A8%2522%252C%2522roleareaid%2522%253A%252215%2522%252C%2522sPartition%2522%253A%252215%2522%257D',
    'LOLWebSet_AreaBindInfo_9BEE1EE2E094CEC1831F908F0194A776': '%257B%2522areaid%2522%253A%252215%2522%252C%2522areaname%2522%253A%2522%25E6%259A%2597%25E5%25BD%25B1%25E5%25B2%259B%2520%25E7%2594%25B5%25E4%25BF%25A1%2522%252C%2522sRoleId%2522%253A0%252C%2522roleid%2522%253A%25221917755878%2522%252C%2522rolename%2522%253A%2522%25E6%259A%2597%25E6%2583%25B3%25E8%25A6%2581%25E6%25BD%25AE%25E5%25B8%2581%252314004%2522%252C%2522checkparam%2522%253A%2522lol%257Cyes%257C1917755878%257C15%257C1917755878*%257C%257C%257C%257C%2525E6%25259A%252597%2525E6%252583%2525B3%2525E8%2525A6%252581%2525E6%2525BD%2525AE%2525E5%2525B8%252581%25252314004*%257C%257C%257C1716342317%257C%2522%252C%2522md5str%2522%253A%2522576B3132B6F8D43CEDABBD7A537AD8A8%2522%252C%2522roleareaid%2522%253A%252215%2522%252C%2522sPartition%2522%253A%252215%2522%257D',
    'uin_cookie': 'o2798983314',
    'ied_qq': 'o2798983314',
    'ts_uid': '2299530869',
    'LW_sid': 'w1w7V2H3H3E5H135W2E320k0o0',
    '_qimei_h38': 'e14793118bea944419012ae202000008917812',
    'o_cookie': '2798983314',
    'fqm_sessionid': 'cfa5ee5f-6de7-4215-acb9-5d5a90021c5c',
    'pgv_info': 'ssid=s7038729413',
    'ts_refer': 'cn.bing.com/',
    '_qpsvr_localtk': '0.6135527764609021',
    'login_type': '1',
    'psrf_musickey_createtime': '1726452119',
    'euin': 'owSqNeEFoio57n**',
    'psrf_qqaccess_token': 'BCF8550B47D23FED18A653F618163CE5',
    'psrf_qqunionid': 'B23EFFD5EA227A3F56037E2F06779397',
    'psrf_qqopenid': '66240412ADB2673CBC09879FBB1E6370',
    'psrf_qqrefresh_token': 'D0EBF4A0A40C0F25180D988EBA0E4C87',
    'wxunionid': '',
    'music_ignore_pskey': '202306271436Hn@vBj',
    'wxopenid': '',
    'qqmusic_key': 'Q_H_L_63k3NMq-e-HCTWKN-HguRppVerafxt0FyPTUNRbtklbTx9fg6-4dqUNmOfuitOj5r-KdjCYPAgh2sD5qYja-PfdJoPug',
    'qm_keyst': 'Q_H_L_63k3NMq-e-HCTWKN-HguRppVerafxt0FyPTUNRbtklbTx9fg6-4dqUNmOfuitOj5r-KdjCYPAgh2sD5qYja-PfdJoPug',
    'tmeLoginType': '2',
    'wxrefresh_token': '',
    'psrf_access_token_expiresAt': '1734228119',
    'uin': '2798983314',
    'ts_last': 'y.qq.com/n/ryqq/player',
}

headers = {
    'authority': 'u6.y.qq.com',
    'accept': 'application/json',
    'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
    'content-type': 'application/x-www-form-urlencoded',
    # 'cookie': 'pgv_pvid=6983219160; RK=Vfz1u9if0L; ptcz=bbb241f9630f156fb14d98aa9be6d276c706468eae05be5302d62fbc6364a388; tvfe_boss_uuid=1e9a71a452cdd90f; iip=0; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%22180cd3c4e437a5-023a6f1be1f0b06-4c647e56-1327104-180cd3c4e4472a%22%2C%22first_id%22%3A%22%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E5%BC%95%E8%8D%90%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC%22%2C%22%24latest_referrer%22%3A%22https%3A%2F%2Fwww.yoozhibo.com%2F%22%7D%2C%22%24device_id%22%3A%22180cd3c4e437a5-023a6f1be1f0b06-4c647e56-1327104-180cd3c4e4472a%22%7D; qq_domain_video_guid_verify=f08246011c100678e3b27e63ee69a807; fqm_pvqid=8a0a278d-47a7-483c-a788-9e20fb4adf55; _qimei_q36=; _qimei_fingerprint=cab100068f94021ec44c4082f5660143; o2_uin=247271591; _clck=1ay7mpn|1|fla|0; eas_sid=w1O7n1K5k3g049M4O7m6F1J3B1; LOLWebSet_AreaBindInfo_1917755878=%257B%2522areaid%2522%253A%252215%2522%252C%2522areaname%2522%253A%2522%25E6%259A%2597%25E5%25BD%25B1%25E5%25B2%259B%2520%25E7%2594%25B5%25E4%25BF%25A1%2522%252C%2522sRoleId%2522%253A0%252C%2522roleid%2522%253A%25221917755878%2522%252C%2522rolename%2522%253A%2522%25E6%259A%2597%25E6%2583%25B3%25E8%25A6%2581%25E6%25BD%25AE%25E5%25B8%2581%252314004%2522%252C%2522checkparam%2522%253A%2522lol%257Cyes%257C1917755878%257C15%257C1917755878*%257C%257C%257C%257C%2525E6%25259A%252597%2525E6%252583%2525B3%2525E8%2525A6%252581%2525E6%2525BD%2525AE%2525E5%2525B8%252581%25252314004*%257C%257C%257C1716342317%257C%2522%252C%2522md5str%2522%253A%2522576B3132B6F8D43CEDABBD7A537AD8A8%2522%252C%2522roleareaid%2522%253A%252215%2522%252C%2522sPartition%2522%253A%252215%2522%257D; LOLWebSet_AreaBindInfo_9BEE1EE2E094CEC1831F908F0194A776=%257B%2522areaid%2522%253A%252215%2522%252C%2522areaname%2522%253A%2522%25E6%259A%2597%25E5%25BD%25B1%25E5%25B2%259B%2520%25E7%2594%25B5%25E4%25BF%25A1%2522%252C%2522sRoleId%2522%253A0%252C%2522roleid%2522%253A%25221917755878%2522%252C%2522rolename%2522%253A%2522%25E6%259A%2597%25E6%2583%25B3%25E8%25A6%2581%25E6%25BD%25AE%25E5%25B8%2581%252314004%2522%252C%2522checkparam%2522%253A%2522lol%257Cyes%257C1917755878%257C15%257C1917755878*%257C%257C%257C%257C%2525E6%25259A%252597%2525E6%252583%2525B3%2525E8%2525A6%252581%2525E6%2525BD%2525AE%2525E5%2525B8%252581%25252314004*%257C%257C%257C1716342317%257C%2522%252C%2522md5str%2522%253A%2522576B3132B6F8D43CEDABBD7A537AD8A8%2522%252C%2522roleareaid%2522%253A%252215%2522%252C%2522sPartition%2522%253A%252215%2522%257D; uin_cookie=o2798983314; ied_qq=o2798983314; ts_uid=2299530869; LW_sid=w1w7V2H3H3E5H135W2E320k0o0; _qimei_h38=e14793118bea944419012ae202000008917812; o_cookie=2798983314; fqm_sessionid=cfa5ee5f-6de7-4215-acb9-5d5a90021c5c; pgv_info=ssid=s7038729413; ts_refer=cn.bing.com/; _qpsvr_localtk=0.6135527764609021; login_type=1; psrf_musickey_createtime=1726452119; euin=owSqNeEFoio57n**; psrf_qqaccess_token=BCF8550B47D23FED18A653F618163CE5; psrf_qqunionid=B23EFFD5EA227A3F56037E2F06779397; psrf_qqopenid=66240412ADB2673CBC09879FBB1E6370; psrf_qqrefresh_token=D0EBF4A0A40C0F25180D988EBA0E4C87; wxunionid=; music_ignore_pskey=202306271436Hn@vBj; wxopenid=; qqmusic_key=Q_H_L_63k3NMq-e-HCTWKN-HguRppVerafxt0FyPTUNRbtklbTx9fg6-4dqUNmOfuitOj5r-KdjCYPAgh2sD5qYja-PfdJoPug; qm_keyst=Q_H_L_63k3NMq-e-HCTWKN-HguRppVerafxt0FyPTUNRbtklbTx9fg6-4dqUNmOfuitOj5r-KdjCYPAgh2sD5qYja-PfdJoPug; tmeLoginType=2; wxrefresh_token=; psrf_access_token_expiresAt=1734228119; uin=2798983314; ts_last=y.qq.com/n/ryqq/player',
    'origin': 'https://y.qq.com',
    'referer': 'https://y.qq.com/',
    'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Microsoft Edge";v="122"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'same-site',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0',
}

data = '{"comm":{"cv":4747474,"ct":24,"format":"json","inCharset":"utf-8","outCharset":"utf-8","notice":0,"platform":"yqq.json","needNewCode":1,"uin":2798983314,"g_tk_new_20200303":1781288792,"g_tk":1781288792},"req_1":{"module":"userInfo.VipQueryServer","method":"SRFVipQuery_V2","param":{"uin_list":["2798983314"]}},"req_2":{"module":"userInfo.BaseUserInfoServer","method":"get_user_baseinfo_v2","param":{"vec_uin":["2798983314"]}},"req_3":{"module":"music.lvz.VipIconUiShowSvr","method":"GetVipIconUiV2","param":{"PID":3}},"req_4":{"module":"music.musicasset.SongFavRead","method":"IsSongFanByMid","param":{"v_songMid":["002O2No839TfyB"]}},"req_5":{"module":"music.musichallSong.PlayLyricInfo","method":"GetPlayLyricInfo","param":{"songMID":"002O2No839TfyB","songID":239121147}},"req_6":{"method":"GetCommentCount","module":"music.globalComment.GlobalCommentRead","param":{"request_list":[{"biz_type":1,"biz_id":"239121147","biz_sub_type":0}]}},"req_7":{"module":"music.musichallAlbum.AlbumInfoServer","method":"GetAlbumDetail","param":{"albumMid":"0048RFaG3gfbOR"}},"req_8":{"module":"music.vkey.GetVkey","method":"GetUrl","param":{"guid":"3001967519","songmid":["002O2No839TfyB"],"songtype":[0],"uin":"2798983314","loginflag":1,"platform":"20"}}}'
sign = ctx.call('getSign',data)

params = {
    '_': str(round(time.time()*1000)),
    'sign': sign,
}


response = requests.post(
    'https://u6.y.qq.com/cgi-bin/musics.fcg',
    params=params,
    cookies=cookies,
    headers=headers,
    data=data).json()
print(response)